<?php
/**
 * @description : quickly register a member.
 * @author      : stephen.mo
 * @date        : 2010/08/20
 */
require_once "TVB/OAuth/common.inc.php";
#ini_set('display_errors','on');

$error_message     = NULL;
$reg_success       = FALSE;
$reback_url        = (isset($_REQUEST['reback_url'])) ? $_REQUEST['reback_url'] : NULL;
$lang              = (isset($_REQUEST['lang'])) ? OAuthUtils::chkLang($_REQUEST['lang']) : OAuthConfig::DEFAULT_SUPPORT_LANG;
//path setting.
$base_server_url   = OAuthConfig::OAuthDomainUrl($_SERVER);
$jqtouch_url       = $base_server_url.OAuthModelConfig::DEFAULT_MOBILE_TEMPLATE;
$ajax_url          = $base_server_url.OAuthConfig::DEFAULT_AJAX_URL;
$default_header    = $base_server_url.OAuthConfig::DEFAULT_HEADER_URL;
$success_url       = $base_server_url.OAuthConfig::DEFAULT_SHOW_MESSAGE_URL.'?act=reg&flag=success&lang='.$lang;
//page info vars
$ms_reg_page       = OPI::$register_page_info;
$language_info     = OPI::$language_info;
$payment_buttons   = OPI::$payment_button_info;
$payment_page_info = OPI::$payment_page_info;

//setting the form datas into array.
$using_real_env                = OAuthModelConfig::USING_TEMPLATE_ON_REAL_ENV;
$page                          = OAuthModelConfig::M_PAGE_OF_REGISTRATION;
$microtime                     = OAuthModelConfig::getMicroFloatTime();
$form                          = array();
$form['lang']                  = $lang;
$form['action']                = NULL;
$form['method']                = 'POST';
$form['title']                 = $ms_reg_page[$lang]['register_title'];
$form['register_title']        = $ms_reg_page[$lang]['register_title'];
$form['success_url']           = $success_url;
$form['ajax_url']              = $ajax_url;
//email
$form['email']['title']        = $ms_reg_page[$lang]['email'];
$form['email']['note']         = $ms_reg_page[$lang]['email_msg'];
$form['email']['value']        = NULL;
//password
$form['password']['title']     = $ms_reg_page[$lang]['password'];
$form['password']['value']     = NULL;
$form['password']['note']      = $ms_reg_page[$lang]['password_msg'];
//repassword
$form['repassword']['title']   = $ms_reg_page[$lang]['repassword'];
$form['repassword']['value']   = NULL;
$form['repassword']['note']    = NULL;
//captcha
$form['captcha']['title']      = $ms_reg_page[$lang]['captcha'];
$form['captcha']['note']       = $ms_reg_page[$lang]['captcha_note'];
$form['captcha']['value']      = NULL;
//hidden
$form['hidden']['register']    = 1;
$form['hidden']['item']        = 'memberReg';
//button
$form['button']['cancel']      = array('value'=>$payment_buttons[$lang]['back'],'link'=>NULL);
$form['button']['register']    = array('value'=>$payment_buttons[$lang]['register'],'link'=>NULL);

//include thie template for plan cmodel page.
include "..".OAuthModelConfig::DEFAULT_MOBILE_TEMPLATE.OAuthModelConfig::$mobile_teplate_page[$page];

?>
